<!--#include file="../nav/top.php" -->
<!--#include file="../nav_menu/user_begin.php" -->


	<form id="myform" action="" method="post" onsubmit="return false" >
		<div class="infotitle">
			修改资料
		</div>
		<div class="infocontent">
			<div style="height:20px;"></div>
			<table class="mytable" > 
				<tr>
					<td class="mylabel">会员编号：</td>
					<td class="myinfo" >
						 {$rs.username} 
					</td>  
				</tr>  
				
				<tr>
					<td class="mylabel">会员姓名：</td>
					<td class="myinfo" >
						<input type="text" class="textBox" id="name" name="name" value="{$rs.name}"  maxlength="10" style="width:200px" /> 
					</td>  
					<td class="mylabel">性别：</td>
					<td class="myinfo" >
						<select class="textBox" id="sex" name="sex" style="width:200px"  >
							<option value="男" <?PHP if($rs['sex'] == '男') echo 'selected="selected"'; ?>>男</option>
							<option value="女" <?PHP if($rs['sex'] == '女') echo 'selected="selected"'; ?>>女</option>
						</select>
					</td>  
				</tr>   
				<tr>
					<td class="mylabel">手机号码：</td>
					<td class="myinfo" >
						<input type="text" class="textBox" id="phone" name="phone" value="{$rs.phone}"  maxlength="20"  style="width:200px"   /> 
					</td>   
					<td class="mylabel">Email：</td>
					<td class="myinfo" >
						<input type="text" class="textBox" id="email" name="email" value="{$rs.email}"  maxlength="255" style="width:200px" /> 
					</td>  
				</tr>
				 
				<tr>
					<td class="mylabel">固定电话：</td>
					<td class="myinfo" >
						<input type="text" class="textBox" id="tel" name="tel"  value="{$rs.tel}" maxlength="50"  style="width:200px"  /> 
					</td>  
					<td class="mylabel">联系地址：</td>
					<td class="myinfo" >
						<input type="text" class="textBox" id="addr" name="addr"  value="{$rs.addr}" maxlength="255"  style="width:200px"   /> 
					</td> 
				</tr> 
			</table> 
		</div>
	</form>

 		
				
	<div  style="margin:10px auto;text-align:center">
		<button  onclick="fnSave()" class="userbtn">保 存</button>
		<span class="gray">或</span> 
		<a href="/user/index">返 回</a>
	</div> 
		
<script type="text/javascript">
var url_save = '/user/info'; 
var url_return = '/user/index'; 
$().ready(function(){
	o2js.build('ymprompt');
	 
	
	 
	
});
function fnSave(){
	var form = serializeObj("#myform");

	 
	if($.trim(form.name) == ''){
		alert('请输入正确的【会员姓名】');
		$('#name').focus();
		return false;
	}
	
	if($('#phone').val()=='' || !fnRegExp('reg_mobile',$('#phone').val())){
		alert('请输入正确的【手机号码】');
		$('#phone').focus();
		return false;
	}
	if($('#email').val()=='' || !fnRegExp('reg_email',$('#email').val())){
		alert('请输入正确的【Email】');
		$('#email').focus();
		return false;
	}
	
	
	$('button').attr('disabled','disabled');
	$.post(
		url_save,
		{
			form:JSON.encode(form)
		},
		function(e){
			var ok = errorHandler(e); 
			if(ok && ok.success=='1'){
				jumpTo(url_return);
			}else{
				$('button').attr('disabled','');
			}	
		}
	);
}
</script>

<!--#include file="../nav_menu/user_end.php" -->
<!--#include file="../nav/bottom.php" -->